from dataclasses import dataclass, astuple, asdict

@dataclass(frozen=True)
class Person:
    name: str
    age: int
    iq: int = 100 # attributes with default values should be placed lastly

p1 = Person('John', 25)
p2 = Person('John', 25)
print(p1)
print(p1 == p2)

print(astuple(p1))
print(asdict(p1))